package com.example.springboot1.dao;

import com.example.springboot1.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("select * from user where username=#{username}")
    User getuserByName(String username) ;
    @Select("select count(1) from user where username=#{username}")
    int selectByUsername(String username);
    @Insert("insert into user(username,password,phone,email) values (#{username},#{password},#{phone},#{email})")
    int insertUser(User user);
}
